<template>
  <div class="wrapper">
    <div class="header">
      <img src="../../assets/image/卡通形象.png" class="header_katong_img" />
      <img src="../../assets/image/3.png" class="header_liaotian_img" />
      <img src="../../assets/image/矩形3.png" class="header_juxing_img_left" />
      <img src="../../assets/image/矩形4.png" class="header_juxing_img_right" />
      <img src="../../assets/image/big.png" class="header_img_big" />
    </div>
    <div class="midlle_hook">
      <div class="middle">
        <img src="../../assets/image/small.png" class="middle_img_small_left" />
        <img
          src="../../assets/image/small1.png"
          class="middle__img_small_right"
        />
      </div>
    </div>
    <div class="middle_time">
      <img src="../../assets/image/图层1.png" class="middle_img" />
      <p class="middle_classtime">将于6月7号开课</p>
      <div class="middle_bottom_class">
        <img src="../../assets/image/6.png" class="middle_class_img" />
        <h2>我的课程表</h2>
      </div>
    </div>
    <div class="rated">
      <ul class="rated-ratedList">
        <li
          v-for="(item, index) in ratedList"
          :key="item"
          @click="goDetails(index)"
        >
          <img class="changtiao1" src="../../assets/image/长条1.png" />
          <img class="changtiao2" src="../../assets/image/长条2.png" />
          <img class="changtiao3" src="../../assets/image/长条3.png" />
          <img class="changtiao4" src="../../assets/image/长条4.png" />
          <img :src="item.url" class="animal_img" />
          <h2 class="local">{{ item.local }}</h2>
          <p class="title">{{ item.title }}</p>
          <div class="online_class">
            <p class="online_class_time">{{ item.time }}</p>
            <!-- <button>进教室</button> -->
            <van-button round type="info" class="button">进入教室</van-button>
          </div>
        </li>
      </ul>
    </div>

    <div class="bottom">
      <ul>
        <li>
          <img
            v-if="active == 1"
            @click="MyTabbarclick"
            src="@\assets\image\icon\f_index_show.png"
            alt=""
          /><img
            v-else
            @click="MyTabbarclick"
            src="@\assets\image\icon\f_index_hide.png"
            alt=""
          /><span>首页</span>
        </li>
        <li>
          <img
            v-if="active == 2"
            @click="MyTabbarclick"
            src="@\assets\image\icon\f_Course_show.png"
            alt=""
          />
          <img
            v-else
            @click="CouresListclick"
            src="@\assets\image\icon\f_Course_hide.png"
            alt=""
          /><span>课程</span>
        </li>
        <li>
          <img
            v-if="active == 3"
            @click="Achievementsclick"
            src="@\assets\image\icon\f_Achievements_show.png"
            alt=""
          />
          <img
            v-else
            @click="Achievementsclick"
            src="@\assets\image\icon\f_Achievements_hide.png"
            alt=""
          />
          <span>成长</span>
        </li>
        <li>
          <img
            v-if="active == 4"
            @click="Mineclick"
            src="@\assets\image\icon\f_mine_show.png"
            alt=""
          />
          <img
            v-else
            @click="Mineclick"
            src="@\assets\image\icon\f_mine_hide.png"
            alt=""
          />
          <span>我的</span>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { Button } from "vant";
export default {
  data() {
    return {
      ratedList: [],
      active: 1,
    };
  },
  components: {
    VanButton: Button,
  },
  mounted() {
    fetch(
      "https://www.fastmock.site/mock/2ec37da54c9156ecd5a210206f6bb174/list/api/list"
    )
      .then((response) => response.json())
      .then((res) => {
        // console.log(res);
        this.ratedList = res.data.list;
        console.log(this.ratedList);
      });
  },
  methods: {
    goDetails(i) {
      this.$router.push("/details/" + i);
    },
    MyTabbarclick() {
      // console.log(1);
      this.active = 1;
      this.$router.push("/home/Index");
    },
    CouresListclick() {
      // console.log(1);
      this.active = 2;
      this.$router.push("/home/CouresList");
    },
    Achievementsclick() {
      // console.log(1);
      this.active = 3;
      this.$router.push("/home/Achievements");
    },
    Mineclick() {
      // console.log(1);
      this.active = 4;
      this.$router.push("/home/Mine");
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../assets/css/var.less";
.wrapper {
  width: 100%;
  background-color: white;
  .header {
    background-color: #0091ff;
    height: 108px;
    width: 100%;
    position: relative;
    .header_katong_img {
      width: 113px;
      height: 46px;
      position: absolute;
      left: 39px;
      bottom: 0;
    }
    .header_liaotian_img {
      width: 32px;
      height: 32px;
      position: absolute;
      left: 323px;
      bottom: 40px;
      z-index: 1000;
    }
    .header_juxing_img_left {
      width: 9px;
      height: 20px;
      position: absolute;
      left: 25px;
      bottom: -10px;
      z-index: 999;
    }
    .header_juxing_img_right {
      width: 9px;
      height: 20px;
      position: absolute;
      right: 25px;
      bottom: -10px;
      z-index: 999;
    }
    .header_img_big {
      width: 50px;
      height: 50px;
      position: absolute;
      right: 10px;
      top: 27px;
      opacity: 0.9;
    }
  }
  .midlle_hook {
    background-color: #0091ff;
    .middle {
      border-radius: 30px 30px 0px 0px;
      height: 30px;
      position: relative;
      width: 100%;
      background-color: white;

      .middle_img_small_left {
        position: absolute;
        width: 12px;
        height: 12px;
        left: 19px;
        top: 6px;
      }
      .middle__img_small_right {
        position: absolute;
        width: 12px;
        height: 12px;
        right: 19px;
        top: 6px;
      }
    }
  }
  .middle_time {
    // height: 175px;
    width: 100%;
    .middle_img {
      width: 120px;
      height: 91px;
      margin-left: 21px;
    }
    .middle_classtime {
      margin-left: 36px;
      margin-bottom: 38px;
      font-size: @s-font;
      color: #999;
    }
    .middle_bottom_class {
      display: flex;
      .middle_class_img {
        width: 25px;
        height: 25px;
        margin-left: 21px;
      }
      h2 {
        font-size: @xl-font;
        margin: 2px 0 5px 5px;
      }
    }
  }
  .rated-ratedList {
    margin-bottom: 100px;
    li {
      width: 344px;
      margin: 3px 20px 40px 15px;
      border-radius: 14px;
      position: relative;
      box-shadow: 0.3px 0.3px 10px 0.3px #999;
      .changtiao1 {
        width: 6px;
        height: 22px;
        position: absolute;
        left: 16px;
        top: -9px;
      }
      .changtiao2 {
        width: 6px;
        height: 22px;
        position: absolute;
        left: 30px;
        top: -9px;
      }
      .changtiao3 {
        width: 6px;
        height: 22px;
        position: absolute;
        right: 30px;
        top: -9px;
      }
      .changtiao4 {
        width: 6px;
        height: 22px;
        position: absolute;
        right: 16px;
        top: -9px;
      }
      .animal_img {
        width: 320px;
        height: 178px;
        margin: 14px 13px 15px 12px;
      }
      .local {
        font-size: @l-font;
        margin: 0 0 15px 14px;
      }
      .title {
        width: 320px;
        font-size: @m-font;
        color: #999;
        margin-left: 13px;
        border-bottom: 1px dashed #999;
        padding-bottom: 15px;
      }
      .online_class {
        display: flex;
        justify-content: space-between;
        .online_class_time {
          font-size: @m-font;
          color: #0091ff;
          margin: 23px 0 0 13px;
        }
        .button {
          width: 95px;
          height: 38px;
          background-color: #0091ff;
          border-radius: 30px;
          border: 0;
          margin: 10px 15px 10px 0;
          font-size: @m-font;
          color: white;
        }
      }
    }
  }

  .bottom {
    position: fixed;
    width: 100%;
    bottom: 0;
    ul {
      display: flex;
      justify-content: space-between;
      height: 100%;
      border-top: 1px solid #ccc;
      box-shadow: 0 -5px 10px -10px #000;
      li {
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        font-size: 0.26667rem;
        padding-top: 10px;
        span {
          font-size: 13px;
        }
        img {
          height: 30px;
        }
      }
    }
  }
}
</style>
